package com.example.controller;

import cn.hutool.core.lang.Dict;
import cn.hutool.json.JSONUtil;
import com.xphsc.easyjdbc.page.PageInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;

import javax.servlet.http.HttpServletRequest;
import java.util.Objects;


/**
 * 考勤
 */
public class BaseController {
    public static Logger logger = LoggerFactory.getLogger(BaseController.class);
    protected static HttpStatus HTTP_STATUS;


    protected Integer page2Limit(Integer page) {
        if (Objects.isNull(page)) {
            page = 1;
        }
        return (Math.max(1, page) - 1) * 10;
    }

    protected Integer page2Limit(Integer page, Integer pageSize) {
        if (Objects.isNull(page)) {
            page = 1;
        }
        return (Math.max(1, page) - 1) * pageSize;
    }

}
